<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>显示所有车辆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.net/twitter-bootstrap/4.6.2/css/bootstrap.css">
</head>
<body>
<div><a href="${pageContext.request.contextPath}/add.jsp" class="btn btn-primary float-right  mr-5 my-3">添加</a></div>
<table class="table">
    <thead class="thead-dark">
    <tr>
        <th scope="col">编号</th>
        <th scope="col">车名</th>
        <th scope="col">颜色</th>
        <th scope="col">车速</th>
        <th scope="col">生产年份</th>
        <th scope="col">价格</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="s" items="${cars}">
    <tr>
        <th scope="row">${s.id}</th>
        <td>${s.name}</td>
        <td>${s.color}</td>
        <td>${s.speed}</td>
        <td><fmt:formatDate value="${s.birthday}" pattern="yyyy年MM月dd日"/></td>
        <td>${s.price}</td>
        <td><a href="${pageContext.request.contextPath}/QueryIdServlet?id=${s.id}" class="btn btn-success">更新</a><a href="${pageContext.request.contextPath}/DeleteServlet?id=${s.id}"  class="btn btn-danger mx-2">删除</a></td>
    </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>
